Package-level declarations

Types

Link copied to clipboard
object SrtParser

Parser for SRT (SubRip) subtitle files.

Link copied to clipboard
@Immutable
data class SubtitleCue(val startTime: Long, val endTime: Long, val text: String)

Represents a single subtitle cue with timing information and text content.

Link copied to clipboard
@Immutable
data class SubtitleCueList(val cues: List<SubtitleCue> = emptyList())

Represents a collection of subtitle cues for a specific track.

Link copied to clipboard

Parser for WebVTT subtitle files.

Functions

Link copied to clipboard
@Composable
fun AutoUpdatingSubtitleDisplay(subtitles: SubtitleCueList, currentTimeMs: Long, isPlaying: Boolean, modifier: Modifier = Modifier, textStyle: TextStyle = TextStyle( color = Color.White, fontSize = 18.sp, fontWeight = FontWeight.Normal, textAlign = TextAlign.Center ), backgroundColor: Color = Color.Black.copy(alpha = 0.5f))

A composable function that displays subtitles with automatic time tracking. This version automatically updates the display based on the current playback time.

Link copied to clipboard
@Composable
fun ComposeSubtitleLayer(currentTimeMs: Long, durationMs: Long, isPlaying: Boolean, subtitleTrack: SubtitleTrack?, subtitlesEnabled: Boolean, modifier: Modifier = Modifier, textStyle: TextStyle = TextStyle( color = Color.White, fontSize = 18.sp, fontWeight = FontWeight.Normal, textAlign = TextAlign.Center ), backgroundColor: Color = Color.Black.copy(alpha = 0.5f))

A composable function that displays subtitles over a video player. This component handles loading and parsing subtitle files, and displaying the active subtitles at the current playback time.

Link copied to clipboard
actual suspend fun loadSubtitleContent(src: String): String

Android implementation of the loadSubtitleContent function. Loads subtitle content from a local file or a remote URL.

expect suspend fun loadSubtitleContent(src: String): String

Loads the content of a subtitle file from the given source. This is implemented in a platform-specific way.

actual suspend fun loadSubtitleContent(src: String): String

iOS implementation of the loadSubtitleContent function. Loads subtitle content from a local file or a remote URL.

actual suspend fun loadSubtitleContent(src: String): String

JVM implementation of the loadSubtitleContent function. Loads subtitle content from a local file or a remote URL.

actual suspend fun loadSubtitleContent(src: String): String

WASM JS implementation of the loadSubtitleContent function. Loads subtitle content from a URL using XMLHttpRequest.

Link copied to clipboard
@Composable
fun SubtitleDisplay(subtitles: SubtitleCueList, currentTimeMs: Long, modifier: Modifier = Modifier, textStyle: TextStyle = TextStyle( color = Color.White, fontSize = 18.sp, fontWeight = FontWeight.Normal, textAlign = TextAlign.Center ), backgroundColor: Color = Color.Black.copy(alpha = 0.5f))

A composable function that displays subtitles.